-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing cache location and deleting old files #414
Conversation
src/D2L.Bmx/Program.cs
Outdated
if( !Directory.Exists( BmxPaths.CACHE_DIR ) ) { | ||
Directory.CreateDirectory( BmxPaths.CACHE_DIR ); | ||
File.Delete( Path.Join( BmxPaths.BMX_DIR, "awsCredsCache" ) ); | ||
File.Delete( Path.Join( BmxPaths.BMX_DIR, "sessions" ) ); | ||
File.Delete( Path.Join( BmxPaths.BMX_DIR, "update_check" ) ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to handle exceptions gracefully here for the especially for the cleanup of the old files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the Directory or File functions error out even if the files don't exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mhm, I was more concerned about the other exceptions. Especially for the cleanup part of this (i.e everything aside from CreateDirectory).
https://learn.microsoft.com/en-us/dotnet/api/system.io.file.delete?view=net-7.0#exceptions
Ideally we would like BMX to continue working if for w/e reason it can't actually delete those files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha! makes sense
PR #415 created to format .cs files. |
Auto format cache/file-location Co-authored-by: DotNet Format Bot <[email protected]>
Why
User looking to modify the config file manually may get confused by all the different files in .bmx